
<template>
<div style="width: 430px;height: 932px;">
  <el-form ref="form" :model="pojo" label-width="80px">
    <el-form-item label="申请种类">
      <el-select v-model="pojo.sqzl" placeholder="请选择申请种类">
        <el-option label="汽修" value="汽修"></el-option>
        <el-option label="工程机械" value="工程机械"></el-option>
      </el-select>
    </el-form-item>
    <el-form-item label="工龄">
      <el-input v-model="pojo.age"></el-input>
    </el-form-item>
    <el-form-item label="联系方式">
      <el-input v-model="pojo.phone"></el-input>
    </el-form-item>
    <el-form-item label="擅长">
      <el-select v-model="pojo.sc" placeholder="请选择">
        <el-option label="机修" value="机修"></el-option>
        <el-option label="电工" value="电工"></el-option>
        <el-option label="轮胎" value="轮胎"></el-option>
        <el-option label="电焊" value="电焊"></el-option>
      </el-select>
    </el-form-item>
    <el-form-item label="主要事迹">
      <el-input type="textarea" v-model="pojo.zysj"></el-input>
    </el-form-item>
    <el-form-item>
      <el-button type="primary" @click="toaddApply()">立即申请</el-button>
      <el-button type="primary" @click="pojo={}">清空</el-button>
    </el-form-item>
  </el-form>
</div>
</template>

<script>
import axios from "axios";

export default {
  data() {
    return {
      pojo:{},
    }
  },
  methods: {
    toaddApply(){
      if(this.pojo.sqzl==null&&this.pojo.name==null&&this.pojo.age==null&&this.pojo.phone==null&&this.pojo.sc==null&&this.pojo.zysj==null){
        this.$message.error("请填写完整信息")
      }else{
        this.$message.success("申请提交成功")
        axios.post("/applyfor/addApply",this.pojo).then(res=>{
          //跳转页面
          this.$router.push("/examinepage")
        })
      }
    }
  },
  created() {
  }
}
</script>


<style scoped>

</style>
